package pojo;

/**
 * HomeworkDifficultyId entity. @author MyEclipse Persistence Tools
 */

public class HomeworkDifficultyId implements java.io.Serializable {

	// Fields

	private Homework homework;
	private Difficulty difficulty;

	// Constructors

	/** default constructor */
	public HomeworkDifficultyId() {
	}

	/** full constructor */
	public HomeworkDifficultyId(Homework homework, Difficulty difficulty) {
		this.homework = homework;
		this.difficulty = difficulty;
	}

	// Property accessors

	public Homework getHomework() {
		return this.homework;
	}

	public void setHomework(Homework homework) {
		this.homework = homework;
	}

	public Difficulty getDifficulty() {
		return this.difficulty;
	}

	public void setDifficulty(Difficulty difficulty) {
		this.difficulty = difficulty;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof HomeworkDifficultyId))
			return false;
		HomeworkDifficultyId castOther = (HomeworkDifficultyId) other;

		return ((this.getHomework() == castOther.getHomework()) || (this
				.getHomework() != null && castOther.getHomework() != null && this
				.getHomework().equals(castOther.getHomework())))
				&& ((this.getDifficulty() == castOther.getDifficulty()) || (this
						.getDifficulty() != null
						&& castOther.getDifficulty() != null && this
						.getDifficulty().equals(castOther.getDifficulty())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getHomework() == null ? 0 : this.getHomework().hashCode());
		result = 37
				* result
				+ (getDifficulty() == null ? 0 : this.getDifficulty()
						.hashCode());
		return result;
	}

}